package com.yelobblog.yelobblog.common.exception;

/**
 * 错误枚举
 * @author: yaohw
 * @create: 2019-10-25 17:15
 **/
public enum ErrorEnum {
    /**
     * 成功
     */
    SUCCESS(0,"操作成功"),

    /**
     * 用户名或密码错误
     */
    BAD_CREDENTIALS(1001,"用户名或密码错误"),
    /**
     * 邮箱已注册
     */

    EMAIL_REGISTERED(1002,"邮箱已注册"),

    /**
     * 用户不存在
     */
    USER_NOT_FOUND(1003,"用户不存在"),
    /**
     * 密码错误
     */

    PASSWORD_ERROR(1004,"密码错误"),
    /**
     * 邮箱发送失败
     */

    EMAIL_SEND_ERROR(1005,"邮箱发送失败"),
    /**
     * 验证码错误
     */
    CODE_ERROR(1006,"验证码错误"),


    AVATAR_UPLOAD_ERROR(1007,"头像上传失败"),

    USER_ALREADY_FOLLOWED(1008,"用户已关注"),

    USER_NOT_FOLLOWED(1009,"用户未关注"),

    ARTICLE_NOT_FOUND(1010,"文章不存在"),

    ARTICLE_NOT_BELONE_YOU(1011,"文章不属于你"),

    ARTICLE_ADD_FAILED(1012,"文章添加失败"),

    COMMENT_NOT_BELONE_YOU(1013,"评论不属于你"),

    UPLOAD_FAST(1014,"上传过快"),

    UPLOAD_LIMIT(1015,"上传数量超过限制"),

    COMMENT_FREQUENTLY(1016,"评论频繁"),

    GET_API_LIMIT(1017,"获取API次数限制"),

    NO_AUTHORITY( 1018,"无权限"),

    /**
     * 账号禁用
     */
    ACCOUNT_DISABLE(1003,"账号已禁用"),

    /**
     * 账号已过期
     */
    ACCOUNT_EXPIRED(1004,"账号已过期"),

    /**
     * 账号已锁定
     */
    ACCOUNT_LOCKED(1005,"账号已锁定"),

    /**
     * 凭证已过期
     */
    CREDENTIALS_EXPIRED(1006,"凭证已过期"),

    /**
     * 不允许访问
     */
    ACCESS_DENIED(1007,"不允许访问"),

    /**
     * 无权限访问
     */
    PERMISSION_DENIED(1008,"无权限访问"),

    /**
     * 凭证无效或已过期
     */
    CREDENTIALS_INVALID(1009,"凭证无效或已过期"),

    /**
     * 刷新凭证无效或已过期
     */
    REFRESH_CREDENTIALS_INVALID(1010,"刷新凭证无效或已过期"),

    /**
     * 无效请求
     */
    INVALID_REQUEST(1011,"无效请求或请求不接受"),

    /**
     */
    REQUEST_LIMIT(1012,"接口访问次数限制"),

    /**
     * 系统异常
     */
    SYSTEM_ERROR(1013,"系统异常");

    /**
     * 错误码
     */
    private Integer errorCode;

    /**
     * 错误信息
     */
    private String errorMsg;

    ErrorEnum(int errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}

